namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class _20200529001 : DbMigration
    {
        public override void Up()
        {
            RenameColumn(table: "dbo.MoBan_Path", name: "MoBanMain_mbid", newName: "MoBan_Main_mbid");
            RenameIndex(table: "dbo.MoBan_Path", name: "IX_MoBanMain_mbid", newName: "IX_MoBan_Main_mbid");
            AddColumn("dbo.MoBan_Path", "isinclude", c => c.Boolean(nullable: false));
            AddColumn("dbo.MoBan_Path", "ParentMoBanMain_mbid", c => c.Int());
            AddColumn("dbo.MoBan_Path", "SonMoBanMain_mbid", c => c.Int());
            CreateIndex("dbo.MoBan_Path", "ParentMoBanMain_mbid");
            CreateIndex("dbo.MoBan_Path", "SonMoBanMain_mbid");
            AddForeignKey("dbo.MoBan_Path", "ParentMoBanMain_mbid", "dbo.MoBan_Main", "mbid");
            AddForeignKey("dbo.MoBan_Path", "SonMoBanMain_mbid", "dbo.MoBan_Main", "mbid");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.MoBan_Path", "SonMoBanMain_mbid", "dbo.MoBan_Main");
            DropForeignKey("dbo.MoBan_Path", "ParentMoBanMain_mbid", "dbo.MoBan_Main");
            DropIndex("dbo.MoBan_Path", new[] { "SonMoBanMain_mbid" });
            DropIndex("dbo.MoBan_Path", new[] { "ParentMoBanMain_mbid" });
            DropColumn("dbo.MoBan_Path", "SonMoBanMain_mbid");
            DropColumn("dbo.MoBan_Path", "ParentMoBanMain_mbid");
            DropColumn("dbo.MoBan_Path", "isinclude");
            RenameIndex(table: "dbo.MoBan_Path", name: "IX_MoBan_Main_mbid", newName: "IX_MoBanMain_mbid");
            RenameColumn(table: "dbo.MoBan_Path", name: "MoBan_Main_mbid", newName: "MoBanMain_mbid");
        }
    }
}
